package com.tm.enums;


public enum ResultEnum {
    SUCCESS(200,"操作成功滴长"),
    SENDSMS_SUCCESS(200,"短信已发送请注意查收"),
    ERROR(201,"操作失败滴长"),
    QUERY_ERROR(202,"查询异常"),
    ADD_ERROR(203,"数据异常"),
    UPLOADIND_ERROR(204,"图片上传异常"),
    SENDSMS_ERROR(205,"验证码错误"),
    LOGON_SECCESS(200,"登录成功"),
    LOGON_ERROR(206,"登录失败，密码或账号错误"),
    OVERDUE_ERROR(207,"验证码过期"),
    NETWORK_ERROR(208,"网络故障"),
    QUIT_SUCCESS(200,"退出成功"),
    ;
    private Integer code;
    private String msg;

    ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static ResultEnum find(Integer code){
        for (ResultEnum resultEnum : ResultEnum.values()) {
            if(resultEnum.getCode() == code){
                return resultEnum;
            }
        }
        return null;
    }
    public static void main(String[] args) {
        System.out.println(find(201).getMsg());
    }
























}
